<template>
  <div>
    <v-g-editor ref="Nodes">
      <flow :data="nodeData" style="display:none;" />
      <minimap :width="550" :height="550" />
    </v-g-editor>
  </div>
</template>

<script>
import VGEditor, { Flow, Minimap } from 'vg-editor';

export default {
  name: 'NodeData',
  components: {
    VGEditor,
    Flow,
    Minimap
  },
  props: {
    // 节点审批数据
    nodeData: {
      type: Object
    }
  },
  // 监听
  watch: {
    // 选择数据回显格式
    nodeData: {
      handler () {
        this.getNews();
      }
    }
  },
  methods: {
    getNews () {
      let nodes = this.nodeData;
      this.$refs.Nodes.propsAPI.read(nodes);
    }
  },
  data () {
    return {
      // nodes: {}
    };
  }
};
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
